<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

    <ui:composition template="layout.xhtml">        
        <ui:define name="title">
            Pesquisar Tipo do Selo
        </ui:define>
        
        <ui:define name="content">   
            <h:form id="pesquisarTipoSeloForm">
                <p:messages id="pesquisarTipoSeloMessages" autoUpdate="true" />
                <div class="actions">
                    <div id="buttons">
                        <p:button value="Cadastrar" outcome="criarTipoSelo.xhtml"
                                  icon="ui-icon-plus" styleClass="ui-priority-primary">            
                    </p:button>
                    </div>
                 </div>
                    
                <p:fieldset legend="Filtros" id="dadosFieldset">
                    <f:validateBean disabled="true">
                        <div class="row">
                            <div class="column1">
                                <p:outputLabel value="Nome" for="nomeInputText" />                            
                            </div>
                            <div class="column4">
                                <p:inputText id="nomeInputText" value="#{ managerPesquisarTipoSelo.tipoSeloPesquisar.nome }"/>
                            </div>
                            <div class="column2">
                                <p:outputLabel value="Descrição" for="descricaoInputText" />
                            </div>
                            <div class="column5">
                                <p:inputText id="descricaoInputText" value="#{ managerPesquisarTipoSelo.tipoSeloPesquisar.descricao }"/>
                            </div>
                        </div>
                    </f:validateBean>
                       </p:fieldset>
                    
                    <div class="command">
                        <p:commandButton
                            id="pesquisarcommandButton" value="Pesquisar" icon="ui-icon-search" styleClass="ui-priority-primary"
                            update="@form" actionListener="#{ managerPesquisarTipoSelo.pesquisar() }" />
                        <p:commandButton value="Limpar" icon="ui-icon-close" update="@form"
                            actionListener="#{ managerPesquisarTipoSelo.limpar() }"/>
                    </div>
                    
                    <p:dataTable id="tiposSeloDataTable" var="tipoSelo" value="#{ managerPesquisarTipoSelo.tiposSelo }"
                        rows="10" paginator="true" paginatorPosition="bottom" emptyMessage="Nenhum registro encontrado">
                        
                        <p:column headerText="Opções" width="5%">
                            <div class="options1">

                                <p:button
                                    title="Visualizar" href="visualizarTipoSelo.xhtml?tipoSeloId=#{ tipoSelo.id }"
                                    icon="ui-icon-search"/>

                            </div>
                        </p:column>
                        
                        <p:column headerText="Nome" width="35%">
                            <h:outputText value="#{ tipoSelo.nome }" />
                        </p:column>
                        <p:column headerText="Aplicação" width="35%">
                            <h:outputText value="#{ tipoSelo.aplicacao.nome }" />
                        </p:column>
                        <p:column headerText="Cor do selo" width="15%">
                            <div class="color" style="background: \##{ tipoSelo.corSelo }"></div>
                        </p:column>
                    </p:dataTable>
                    
                

            </h:form>
        </ui:define>
    </ui:composition>
    
</html>